$(function (){

    $("#reg").click(function (){
        let sex = $("#sexi").find("option:selected").val()
        let username = $("#usernamei").val()
        let password = $("#passwordi").val()
        let hobby = $("#hobbyi").val()
        let age = $("#agei").val()
        $.ajax({
            type:"post",
            url:"http://127.0.0.1:9090/reg",
            data:{username:username,password:password,hobby:hobby,age:age,sex:sex},
            success:function (res){
                alert("注册成功!")
                window.location.href="login.html"

            },
            error:function (err){
                alert("请求失败")
                console.log(err)
            },

        })
    })
})